<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss">
    <title>新增服务项</title>
</head>
<body>
<div class="layui-fluid">

    <blockquote class="layui-crumb">
        <a lay-href="/service/tariff/list.action">价格表管理&nbsp;&nbsp;</a>/&nbsp;
        <span th:text="${faultTariff.tariffName}"></span>&nbsp;&nbsp;/&nbsp;
        <span th:text="${servCategory.name}"></span>&nbsp;&nbsp;/&nbsp;
        <span th:text="${baseCategory.name}"></span>&nbsp;&nbsp;/&nbsp;
        <span>使用项目</span>&nbsp;&nbsp;/&nbsp;
        <span th:text="${faultGroup.groupAlias}"></span>&nbsp;&nbsp;/&nbsp;
        <span th:text="${faultItem.itemId>1?faultItem.itemName:'新增项目'}"></span>

    </blockquote>

    <div class="layui-card">

        <div th:replace="service/item/_detailtab::tab"></div>


        <div class="layui-card-body">
            <form method="post" action="" class="layui-form" lay-filter="zmn-form">
                <input type="hidden" name="itemId" id="itemId" th:value="${faultItem.itemId}">
                <input type="hidden" name="groupId" id="groupId"  th:value="${faultItem.groupId}"/>
                <input type="hidden" name="tariffId" id="tariffId"  th:value="${faultGroup.tariffId}"/>
                <input type="hidden" name="servCategId" id="servCategId"  th:value="${servCategory.categId}"/>
                <input type="hidden" name="categOneId" id="categOneId"  th:value="${baseCategory.categId}"/>

                <div class="layui-form-item" style="margin-bottom: 0px;">
                    <label class="layui-form-label"style="color: rgba(0, 0, 0, 0.447058823529412);line-height: 1;font-size: 13px;">提示:</label>
                        <div>
                            <span style="color: rgba(0, 0, 0, 0.447058823529412);">1.在配置的时间范围内，工程师才能在工程师APP选择该项目</span>
                        </div>
                        <div>
                            <span style="color: rgba(0, 0, 0, 0.447058823529412);">2.时间段和日期对应，最多可添加10组</span>
                        </div>
                </div>

                <div class="layui-card-header" style="border-bottom:0px"><b></b></div>

                <div class="time-section" th:each="timeGroup,itemStat:${timeGroups}">
                    <!--日期只有一个-->
                    <div class="layui-form-item group">
                        <label class="layui-form-label" th:text="'时间段'+${itemStat.index+1}+':'"></label>
                        <div class="layui-input-inline">
                            <input type="text" name="dateStr"  lay-filter="name" th:value="${timeGroup.dateStr}" placeholder="日期"
                                   lay-verify="required"  autocomplete="off" class="layui-input dateStr" th:id="'dateStr'+${itemStat.index+1}"/>
                        </div>
                        <span class="layui-btn addGroup" style="font-size: 30px">+</span>
                        <span class="layui-btn layui-btn-primary minusGroup" th:attr="configId=${timeGroup!=null?timeGroup.configId:'0'}"><i class="layui-icon layui-icon-delete"></i></span>
                    </div>

                    <!--时间有多个-->
                    <div class="layui-form-item times" th:each="time,timeStat:${timeGroup.timeStrList}">
                        <label class="layui-form-label"></label>
                        <div class="layui-input-inline">
                            <input type="text" name="timeStrList"  lay-filter="name" th:value="${time}" placeholder="时间段"
                                   lay-verify="required"  autocomplete="off" class="layui-input timeStrList" th:id="'timeStrList'+${itemStat.index+1}+${timeStat.index+1}"/>
                        </div>
                        <span class="layui-btn addTime" style="font-size: 30px">+</span>
                        <span class="layui-btn layui-btn-primary minusTime"  th:attr="configId=${timeGroup!=null?timeGroup.configId:'0'}"><i class="layui-icon layui-icon-delete"></i></span>
                    </div>

                </div>



                <div class="layui-form-item submit">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-form-submit">保存</button>
                        <button type="reset" class="layui-btn layui-btn-primary" id="cancelBtn">取消
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<div class="time-section" id="copyDiv" style="display: none">
    <div class="layui-card-header" style="border-bottom:0px"><b></b></div>
    <!--日期只有一个-->
    <div class="layui-form-item group">
        <label class="layui-form-label">时间段1:</label>
        <div class="layui-input-inline">
            <input type="text" name="dateStr" lay-filter="name" value="" placeholder="日期" lay-verify="required" autocomplete="off" class="layui-input dateStr">
        </div>
        <span class="layui-btn addGroup" style="font-size: 30px">+</span>
        <span class="layui-btn layui-btn-primary minusGroup"><i class="layui-icon layui-icon-delete"></i></span>
    </div>

    <!--时间有多个-->
    <div class="layui-form-item times">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="text" name="timeStrList" lay-filter="name" value="" placeholder="时间段" lay-verify="required" autocomplete="off" class="layui-input timeStrList">
        </div>
        <span class="layui-btn addTime" style="font-size: 30px">+</span>
        <span class="layui-btn layui-btn-primary minusTime"><i class="layui-icon layui-icon-delete"></i></span>
    </div>

</div>


</body>
</html>

<script type="text/javascript" th:inline="javascript">
    layui.config({
        base: "/static/lay/",
        version:2011241001241
    }).extend({
        index: "lib/index",
        serv_service_item_config_detail: "service/item/config/serv.service.item.config.detail"
    }).use(['index', 'serv_service_item_config_detail']);
</script>
